<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php 
//JHTML::_('behavior.tooltip'); 
//$editor =& JFactory::getEditor();
//jimport('joomla.filter.output');
//JOutputFilter::objectHTMLSafe($this->event);
?>

<form action="index.php" method="post" name="adminForm">

<div style=" clear:none">
	<fieldset class="adminform">
		<legend><?php echo JText::_( 'Event Category CSS Parameters' ); ?></legend>

		<table class="admintable">
		<tr>
			<td valign="top" width="800" style="padding: 7px 0 0 5px">
			<?php
				jimport('joomla.html.pane');
				//jimport('joomla.filter.output');
				//JOutputFilter::objectHTMLSafe( $row );
			//	JHTML::_('behavior.calendar');
//				$db		=& JFactory::getDBO();
				//$editor =& JFactory::getEditor();
				$pane	=& JPane::getInstance('Tabs');
				$form = new JParameter( '', JPATH_COMPONENT.DS.'helpers'.DS.'editcatcss.xml');
				//get time
			//	$this->event->params =  $this->event->params."\ntime=".$this->event->reg->getValue('hour').":".$this->event->reg->getValue('minute').":".$this->event->reg->getValue('second');
				
			//	$form->loadINI($this->data);
				//if(empty($this->event->publish_up){
					//$form->set('start_date', JHTML::_('date', $this->event->start_date, '%Y-%m-%d'));
				//$form->set('publish_up', $this->event->start_date." ".$this->event->start_time);
				
					//$form->set('hour', $this->time_selector_obj->hours);
				//}
				/*
				ContentView::_displayArticleStats($row, $lists);
				*/
				
				echo $pane->startPane("content-pane");
							
				$title = JText::_( 'Event Categories' );
				echo $pane->startPanel( $title, "event_cat" );
				////////////////////////////////////////////////////////////////////////////////////////
				//var_dump($this);
				$html ='<table><tr>';
				if(count($this->cat_data) > 0){
					foreach($this->cat_data as $cat){
				//	$this->cat = $cat;	
				//var_dump('cycle');	
				$html .='<td style="float: left; width: 200px; background-color:#dddddd; margin: 2px 2px 2px 2px">'
				
				.'<p>'. $cat->id .'&nbsp;&nbsp;&nbsp;'. $cat->catname .'</p>'
					.'<table class="paramlist admintable" cellspacing="1" width="100%">'
						.'<tbody><tr>'
							.'<td class="paramlist_key" width="40%">'
								.'<span class="editlinktip">'
									.'<label id="'.$cat->id .'paramsevent_fg-lbl" for="'. $cat->id
										.'paramsevent_fg" class="hasTip" title="Event Foreground::Default foreground color for event listings">Event Foreground'
									.'</label>'
								.'</span>'
							.'</td>'
							.'<td class="paramlist_value">'
								.'<input name="params[cat_id]['. $cat->id .'][event_fg]" id="'. $cat->id 
									.'paramsevent_fg" value="'. $cat->event_fg .'" class="text_area" size="10" type="text">'
							.'</td>'
						.'</tr>'
						.'<tr>'
							.'<td class="paramlist_key" width="40%">'
							
				.'<span class="editlinktip">'
					.'<label id="'. $cat->id.'paramsevent_bg-lbl" for="'. $cat->id.'paramsevent_bg" class="hasTip" title="Event Background::Default background color for event listings">Event Background'
					.'</label>'
				.'</span>'
			.'</td>'
			.'<td class="paramlist_value">'
				.'<input name="params[cat_id]['. $cat->id .'][event_bg]" id=" '. $cat->id.'paramsevent_bg" value="'. $cat->event_bg .'" class="text_area" size="10" type="text">'
			.'</td>'
		.'</tr>'
		.'<tr>'
			.'<td class="paramlist_key" width="40%">'
				.'<span class="editlinktip">'
					.'<label id=" '. $cat->id.'paramsrounded-lbl" for="'. $cat->id.'paramsrounded" class="hasTip" title="Rounded Corners::Display event listings with rounded corners">Rounded Corners'
					.'</label>'
				.'</span>'
			.'</td>'
			.'<td class="paramlist_value">'
				.'<input name="params[cat_id]['. $cat->id .'][rounded]" id="'. $cat->id.'paramsrounded0" ';
				
																		($cat->rounded < 1)? $html .= 'checked="checked"': $html .= '';
																		
					$html .= ' type="radio">'
				.'<label for="'. $cat->id.'paramsrounded0">Square</label>'
				.'<input name="params[cat_id]['. $cat->id .'][rounded]" id="'. $cat->id.'paramsrounded1" value="1" ';
				
																		($cat->rounded > 0)? $html .= 'checked="checked"': $html .= '';
																		
					$html .= ' type="radio">'
				.'<label for="'. $cat->id.'paramsrounded1">Rounded</label>'
			.'</td>'
		.'</tr>'
		.'<tr>'
			.'<td class="paramlist_key" width="40%">'
				.'<span class="editlinktip">'
					.'<label id="'. $cat->id.'paramsradius-lbl" for="'. $cat->id.'paramsradius" class="hasTip" title="Corner Radii::Radii of corners(if Rounded Corners is selected)">Corner Radii'
					.'</label>'
				.'</span>'
			.'</td>'
			.'<td class="paramlist_value">'
				.'<input name="params[cat_id]['. $cat->id .'][radius]" id="'. $cat->id.'paramsradius" value="'. $cat->radius .'" class="text_area" size="10" type="text">'
			.'</td>'
		.'</tr>'
		.'<tr>'
			.'<td class="paramlist_key" width="40%">'
				.'<span class="editlinktip">'
					.'<label id="'. $cat->id.'paramsmargin-lbl" for="'. $cat->id.'paramsmargin" class="hasTip" title="Event Margins::Margin between the edge of the Day Cell and the Event Listing">Event Margins'
					.'</label>'
				.'</span>'
			.'</td>'
			.'<td class="paramlist_value">'
				.'<input name="params[cat_id]['. $cat->id .'][margin]" id="'. $cat->id.'paramsmargin" value="'. $cat->margin .'" class="text_area" size="10" type="text">'
			.'</td>'
		.'</tr>'
		.'</tbody>'
	.'</table>'
.'</td>';

			}//edn foreach category
			echo $html.'</tr></table>';
		}//end if
/////////////////////////////////////////////////////////////////
//				echo $this->cat_html;//$form->render('params', 'event_cat');
				echo $pane->endPanel();
				$title = JText::_( 'Category CSS Defaults' );
				echo $pane->startPanel( $title, "general" );
				echo '<table><tr><td style=" width:175px">';
				echo $form->render('params','general');
				echo '</td><td style="float:left; width:200px">';
				echo $form->render('params','details');
				echo '</td></tr></table>';
				echo $pane->endPanel();
				/*
				$title = JText::_( 'Calendar Categoies' );
				echo $pane->startPanel( $title, "params-page" );
				echo $form->render('params', 'advanced');
				echo $pane->endPanel();
				*/
				/*
				$title = JText::_( 'Metadata Information' );
				echo $pane->endPanel();
				echo $pane->startPanel( $title, "metadata-page" );
				echo $form->render('meta', 'metadata');
				*/
				echo $pane->endPane();
				
			?>
			
			</td>
		</tr>
		</table>
	</fieldset>
</div>

<div class="clr"></div>
<input type="hidden" name="option" value="com_eventlist" />
<input type="hidden" name="controller" value="editcatcss" />
<input type="hidden" name="task" value="" />

</form>
